package com.biqee.action.admin;

import java.util.List;

import com.biqee.action.base.BaseAction;
import com.biqee.model.common.PageInfoObject;
import com.biqee.model.db.BqTuan;
import com.biqee.service.bq.BqTuanService;
import com.biqee.service.bq.EstimateService;

public class TuanAction extends BaseAction{

	private static final long serialVersionUID = -271061134288684156L;
	
	private BqTuanService bqTuanService;
	
	private PageInfoObject page = new PageInfoObject() ;
	
	private Integer tuanId ;
	
	private EstimateService estimateService;
	
	private List<BqTuan> tuanList ;
	
	
	public String list(){
		page = new PageInfoObject();
		page.setLimit(100);
		tuanList = bqTuanService.listTuanByPage(page);
	    return "list";
	}
	
	
	public String  estimate(){
		if(tuanId!=null){
			estimateService.reEstimate(tuanId);
			return SUCCESS;
		}
		return INPUT;
	}

	public Integer getTuanId() {
		return tuanId;
	}

	public String delete(){
		if(tuanId!=null){
			bqTuanService.delete(tuanId);
		}
		return INPUT;
	}

	public void setTuanId(Integer tuanId) {
		this.tuanId = tuanId;
	}

	public void setBqTuanService(BqTuanService bqTuanService) {
		this.bqTuanService = bqTuanService;
	}

	public List<BqTuan> getTuanList() {
		return tuanList;
	}

	public void setTuanList(List<BqTuan> tuanList) {
		this.tuanList = tuanList;
	}

	public PageInfoObject getPage() {
		return page;
	}

	public void setPage(PageInfoObject page) {
		this.page = page;
	}

	public void setEstimateService(EstimateService estimateService) {
		this.estimateService = estimateService;
	}


}
